<?php
require_once './libraries/utilites/functions.php';
$path = 'data/films.txt';


$full_path = realpath($path);
$films = mreadFile($path);
?>
<form method="POST">
<?php foreach ($films as $items ):?>
 <?php 
 $a = trim($items,"\t\r\n "); 
    $film = explode(";", $a);
    if($_GET["if"] == $film[0]):?>

 Name : <input type="text" size="30px;" value="<?php echo $film[2] ?>"></br>
 Rating : <input type="text" size="30px;" value="<?php echo $film[3] ?>"></br>
 <img src = 'public/images/films/<?php echo $film[1]; ?>'>
       <input type="submit" value="Save" >
       </br>       
    <?php endif; ?>
   <?php endforeach; ?>
       <a href="file.php">Back</a>
</form>

